Skip to content

Conversation

jcortes
Copy link
Collaborator

@jcortes jcortes commented Oct 16, 2025

WHY

Resolves #18614

Summary by CodeRabbit

  • New Features

    • Add/remove event guide actions; patch event (capacity/manual reopen)
    • Create, update, delete experience schedules
    • Instant webhook sources for experience, order, and user create/update/delete with sample test events
    • Enhanced app integration with dynamic selections and expanded API actions
  • Chores

    • Package version bumped; core API constants added

@jcortes jcortes self-assigned this Oct 16, 2025
Copy link

vercel bot commented Oct 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Oct 21, 2025 3:51pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Oct 21, 2025 3:51pm

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

Copy link
Contributor

coderabbitai bot commented Oct 16, 2025

Walkthrough

Adds a Xola integration: new action modules (event guides, event patching, schedule CRUD), a shared webhook source plus many instant webhook sources with test fixtures, a refactored xola app with HTTP helpers and many API methods, configuration constants, and a package version bump.

Changes

Cohort / File(s) Summary
Actions: Guides
components/xola/actions/add-event-guide/add-event-guide.mjs, components/xola/actions/remove-event-guide/remove-event-guide.mjs
New actions to add/remove a guide on an event; seller-scoped props and run() call app.addEventGuide / app.removeEventGuide.
Actions: Experience Schedules
components/xola/actions/create-experience-schedule/create-experience-schedule.mjs, components/xola/actions/update-experience-schedule/update-experience-schedule.mjs, components/xola/actions/delete-experience-schedule/delete-experience-schedule.mjs
New actions to create, update, and delete experience schedules; rich props (dates, times, priceDelta, repeat, departure, etc.) and run() call corresponding app methods.
Action: Patch Event
components/xola/actions/patch-event/patch-event.mjs
New action to patch event fields (max, manual) and call app.patchEvent.
Shared Webhook Base
components/xola/sources/common/webhook.mjs
New reusable webhook source base exposing props (app, db, http, userId), activate/deactivate hooks, webhook persistence helpers, create/delete webhook helpers, and a run handler requiring subclass getEventName()/generateMeta().
Instant Sources — Experiences
components/xola/sources/new-experience-created-instant/..., components/xola/sources/experience-updated-instant/..., components/xola/sources/experience-deleted-instant/...
New instant webhook sources for experience create/update/delete that extend the common webhook and implement getEventName() and generateMeta(), with test-event fixtures.
Instant Sources — Orders
components/xola/sources/new-order-created-instant/..., components/xola/sources/order-updated-instant/..., components/xola/sources/order-deleted-instant/...
New instant webhook sources for order create/update/delete extending common webhook, with getEventName(), generateMeta(), and test-event fixtures.
Instant Source — User
components/xola/sources/user-updated-instant/*
New instant webhook source for user updates extending common webhook, with getEventName(), generateMeta(), and a test-event fixture.
Test Event Fixtures
components/xola/sources/*/*/test-event.mjs
Add multiple static test-event payloads (experience, order, user) used by sampleEmit for sources.
App Refactor / API Helpers
components/xola/xola.app.mjs
Major refactor: add propDefinitions (seller/experience/event/schedule/guide selectors), introduce HTTP abstraction (getUrl, getHeaders, makeRequest, post/put/patch/delete), resource helpers (listExperiences, listGuides, listEvents, listSellers, listPurchases), schedule/event/guide methods (create/update/delete schedules, patchEvent, add/remove guide), getUser; remove old authKeys().
Constants
components/xola/common/constants.mjs
New constants module exporting VERSION_PATH, API_VERSION (2025-07-07), DEFAULT_LIMIT (20), DEFAULT_MAX (100).
Package
components/xola/package.json
Bumped version 0.0.1 → 0.1.0 and added dependency "@pipedream/platform": "^3.1.0".

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Runtime as Pipedream Runtime
    participant Source as Webhook Source (common)
    participant XolaAPI
    participant DB

    rect rgb(245,250,255)
    Note over User,Runtime: Source activation
    User->>Runtime: activate source
    Runtime->>Source: activate()
    Source->>XolaAPI: POST /users/{userId}/hooks { endpoint, eventName }
    XolaAPI-->>Source: { id: webhookId }
    Source->>DB: setWebhookId(webhookId)
    DB-->>Source: OK
    end

    rect rgb(240,248,245)
    Note over XolaAPI,Runtime: Event delivery -> emit
    XolaAPI->>Runtime: POST event payload -> source.run(body)
    Runtime->>Source: run(body)
    Source->>Source: generateMeta(body)
    Source->>Runtime: emit({ body, meta })
    end

    rect rgb(255,245,238)
    Note over User,Runtime: Deactivation
    User->>Runtime: deactivate source
    Runtime->>Source: deactivate()
    Source->>DB: getWebhookId()
    DB-->>Source: webhookId
    Source->>XolaAPI: DELETE /users/{userId}/hooks/{webhookId}
    XolaAPI-->>Source: OK
    end
Loading
sequenceDiagram
    participant Invoker as User/Action
    participant Action
    participant App
    participant HTTP
    participant XolaAPI

    Invoker->>Action: invoke(props)
    Action->>App: call method (e.g., createExperienceSchedule / patchEvent / addEventGuide)
    App->>App: getUrl(path) & getHeaders()
    App->>HTTP: makeRequest(method, url, headers, data)
    HTTP->>XolaAPI: HTTP request
    XolaAPI-->>HTTP: response
    HTTP-->>App: response
    App-->>Action: response
    Action->>Invoker: return response and export summary
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested labels

action, trigger / source

Suggested reviewers

  • GTFalcao
  • luancazarine
  • lcaresia

Poem

🐇 I hopped through webhooks, guides, and queues,

Schedules planted, APIs stitched like news.
Test events sparkle, activation sings,
Methods hum and HTTP wings.
Bravo — Xola grows on rabbit paws!

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning The PR implements most of the requirements from issue #18614, including all three experience sources (create, update, delete) [#18614], all three order/purchase sources (create, update, cancel) [#18614], user update source [#18614], all schedule actions (create, update, delete) [#18614], both guide assignment actions (add and remove) [#18614], and event capacity updates [#18614]. However, two stated requirements are missing from the implementation: user/traveler creation source and product price update action. While the majority of objectives are addressed, the absence of these specific features means the PR does not fully meet all stated requirements. Please implement the missing sources and actions to complete the requirements from issue #18614: add a user creation source and implement a product price update action. Alternatively, if these features are intentionally deferred, update the linked issue to reflect the updated scope and explain why they were excluded.
Description Check ⚠️ Warning The PR description contains only the required "WHY" section but provides minimal content—simply stating "Resolves #18614" without elaborating on the reasoning, context, or implementation approach. While the description is not off-topic, it does not meaningfully explain why these components were needed or what problems they solve, falling short of a substantive description that would help reviewers understand the change's rationale.
✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "[Components] Xola - new components" clearly indicates that the changeset adds new components for Xola integration, which is the primary change in this PR. The title follows the repository's naming convention for component PRs and accurately summarizes the main addition, though it could be more specific about the types of components (actions and sources) being added.
Out of Scope Changes Check ✅ Passed All changes in the PR are directly related to Xola integration as specified in issue #18614. The additions include action modules (patch-event, guide assignment, schedule management), source modules (experience and order webhooks), supporting infrastructure (webhook base, app methods, constants), and package configuration updates. No unrelated changes, refactoring, or bug fixes from other concerns are present in the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch xola-new-components

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

♻️ Duplicate comments (1)
components/xola/sources/purchase-updated/purchase-updated.mjs (1)

17-21: Critical: Pagination not implemented — updates beyond first 100 purchases will be missed.

Identical issue to experience-updated.mjs: the hardcoded skip: 0 limits monitoring to only the first 100 purchases, causing updates beyond that threshold to be missed.

Apply the same pagination solution as suggested for experience-updated.mjs.

🧹 Nitpick comments (6)
components/xola/sources/order-updated-instant/order-updated-instant.mjs (1)

4-27: LGTM with a minor optimization suggestion.

The source implementation correctly extends the common webhook base and implements the required methods. The event name matches the test event payload, and the metadata generation follows the established pattern.

Optional micro-optimization: Date.now() is called twice (lines 20 and 22). Consider storing the timestamp in a variable:

 generateMeta(body) {
   const { data } = body;
+  const now = Date.now();
   return {
-    id: `${data.id}-${Date.now()}`,
+    id: `${data.id}-${now}`,
     summary: `Order Updated: ${data.id}`,
-    ts: Date.now(),
+    ts: now,
   };
 },
components/xola/sources/experience-deleted-instant/test-event.mjs (1)

1-8: Consider adding a deletedAt timestamp.

While the minimal payload is acceptable, including a deletedAt field would make the deletion event more informative and consistent with other timestamped events in the fixture suite.

Apply this diff to add the timestamp:

 export default {
   eventName: "experience.delete",
   data: {
     id: "507f1f77bcf86cd799439012",
     name: "City Walking Tour",
+    deletedAt: "2024-01-17T10:00:00Z",
   },
   audit: {},
 };
components/xola/sources/order-deleted-instant/order-deleted-instant.mjs (1)

17-24: Minor: Consider capturing Date.now() once.

The generateMeta method calls Date.now() twice (lines 20 and 22), which could produce slightly different timestamps, though the difference would be negligible in practice.

Apply this diff for consistency:

 generateMeta(body) {
   const { data } = body;
+  const now = Date.now();
   return {
-    id: `${data.id}-deleted-${Date.now()}`,
+    id: `${data.id}-deleted-${now}`,
     summary: `Order Deleted: ${data.id}`,
-    ts: Date.now(),
+    ts: now,
   };
 },
components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (1)

153-168: Consider conditionally including optional fields in the data payload.

Unlike the update action (see components/xola/actions/update-experience-schedule/update-experience-schedule.mjs lines 98-120), this action passes all fields directly without checking if they're provided. This may send undefined or null values to the API.

Apply this pattern for optional fields:

 data: {
-  start,
-  end,
-  dates,
+  ...start && { start },
+  ...end && { end },
+  ...dates && { dates },
   type,
   name,
-  repeat,
-  days,
-  times,
-  departure,
-  priceDelta,
+  ...repeat && { repeat },
+  ...days && { days },
+  ...times && { times },
+  ...departure && { departure },
+  ...priceDelta && { priceDelta },
 },
components/xola/sources/experience-deleted/experience-deleted.mjs (1)

50-53: Hardcoded placeholder name reduces usefulness of deletion events.

The generic "Deleted Experience" name provides no context about what was deleted. While the deleted experience's actual name may not be available (since it's already deleted from the API), consider including the id in a more descriptive format.

         const deletedExperience = {
           id,
-          name: "Deleted Experience",
+          name: `Experience ID: ${id}`,
           deletedAt: new Date().toISOString(),
         };
components/xola/sources/purchase-updated/purchase-updated.mjs (1)

30-59: Consider extracting shared update-tracking logic to the base.

The processEvent() implementation is nearly identical to experience-updated.mjs (lines 30-59), differing only in:

  • Resource function name (listPurchases vs listExperiences)
  • Filtered array name (filteredPurchases vs filteredExperiences)

This duplication increases maintenance burden and risk of inconsistent bug fixes.

Extract the common pattern into the base class (components/xola/sources/common/base.mjs), parameterized by resource type. Example:

// In base.mjs
async processUpdatedResources() {
  const lastUpdatedAt = this._getLastUpdatedAt();
  let maxUpdatedAt = lastUpdatedAt;
  
  // Fetch with pagination (see earlier comment)
  const allResources = await this.fetchAllResources();
  
  const filteredResources = allResources.filter((resource) => {
    const updatedAt = resource.updatedAt;
    const createdAt = resource.createdAt;
    return updatedAt !== createdAt
      && resource.status !== "deleted"
      && (!lastUpdatedAt || new Date(updatedAt) > new Date(lastUpdatedAt));
  });
  
  filteredResources.forEach((resource) => {
    const updatedAt = resource.updatedAt;
    if (!maxUpdatedAt || new Date(updatedAt) > new Date(maxUpdatedAt)) {
      maxUpdatedAt = updatedAt;
    }
    const meta = this.generateMeta(resource);
    this.$emit(resource, meta);
  });
  
  if (maxUpdatedAt) {
    this._setLastUpdatedAt(maxUpdatedAt);
  }
}

Then each source would simply call await this.processUpdatedResources() from processEvent().

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe7f45d and ec3f3d9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (37)
  • components/xola/actions/add-event-guide/add-event-guide.mjs (1 hunks)
  • components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (1 hunks)
  • components/xola/actions/delete-experience-schedule/delete-experience-schedule.mjs (1 hunks)
  • components/xola/actions/patch-event/patch-event.mjs (1 hunks)
  • components/xola/actions/remove-event-guide/remove-event-guide.mjs (1 hunks)
  • components/xola/actions/update-experience-schedule/update-experience-schedule.mjs (1 hunks)
  • components/xola/common/constants.mjs (1 hunks)
  • components/xola/package.json (2 hunks)
  • components/xola/sources/common/base.mjs (1 hunks)
  • components/xola/sources/common/webhook.mjs (1 hunks)
  • components/xola/sources/experience-created/experience-created.mjs (1 hunks)
  • components/xola/sources/experience-created/test-event.mjs (1 hunks)
  • components/xola/sources/experience-deleted-instant/experience-deleted-instant.mjs (1 hunks)
  • components/xola/sources/experience-deleted-instant/test-event.mjs (1 hunks)
  • components/xola/sources/experience-deleted/experience-deleted.mjs (1 hunks)
  • components/xola/sources/experience-deleted/test-event.mjs (1 hunks)
  • components/xola/sources/experience-updated-instant/experience-updated-instant.mjs (1 hunks)
  • components/xola/sources/experience-updated-instant/test-event.mjs (1 hunks)
  • components/xola/sources/experience-updated/experience-updated.mjs (1 hunks)
  • components/xola/sources/experience-updated/test-event.mjs (1 hunks)
  • components/xola/sources/new-experience-created-instant/new-experience-created-instant.mjs (1 hunks)
  • components/xola/sources/new-experience-created-instant/test-event.mjs (1 hunks)
  • components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (1 hunks)
  • components/xola/sources/new-order-created-instant/test-event.mjs (1 hunks)
  • components/xola/sources/new-purchase-created/new-purchase-created.mjs (1 hunks)
  • components/xola/sources/new-purchase-created/test-event.mjs (1 hunks)
  • components/xola/sources/order-deleted-instant/order-deleted-instant.mjs (1 hunks)
  • components/xola/sources/order-deleted-instant/test-event.mjs (1 hunks)
  • components/xola/sources/order-updated-instant/order-updated-instant.mjs (1 hunks)
  • components/xola/sources/order-updated-instant/test-event.mjs (1 hunks)
  • components/xola/sources/purchase-canceled/purchase-canceled.mjs (1 hunks)
  • components/xola/sources/purchase-canceled/test-event.mjs (1 hunks)
  • components/xola/sources/purchase-updated/purchase-updated.mjs (1 hunks)
  • components/xola/sources/purchase-updated/test-event.mjs (1 hunks)
  • components/xola/sources/user-updated-instant/test-event.mjs (1 hunks)
  • components/xola/sources/user-updated-instant/user-updated-instant.mjs (1 hunks)
  • components/xola/xola.app.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-07-24T02:06:47.016Z
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.

Applied to files:

  • components/xola/sources/common/webhook.mjs
🧬 Code graph analysis (18)
components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (2)
components/xola/actions/delete-experience-schedule/delete-experience-schedule.mjs (1)
  • response (36-40)
components/xola/actions/update-experience-schedule/update-experience-schedule.mjs (1)
  • response (94-121)
components/xola/sources/order-deleted-instant/order-deleted-instant.mjs (6)
components/xola/sources/experience-deleted-instant/experience-deleted-instant.mjs (1)
  • body (18-18)
components/xola/sources/experience-updated-instant/experience-updated-instant.mjs (1)
  • body (18-18)
components/xola/sources/new-experience-created-instant/new-experience-created-instant.mjs (1)
  • body (18-18)
components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (1)
  • body (18-18)
components/xola/sources/order-updated-instant/order-updated-instant.mjs (1)
  • body (18-18)
components/xola/sources/user-updated-instant/user-updated-instant.mjs (1)
  • body (18-18)
components/xola/sources/experience-created/experience-created.mjs (4)
components/xola/sources/new-purchase-created/new-purchase-created.mjs (6)
  • lastCreatedAt (31-31)
  • maxCreatedAt (32-32)
  • params (33-33)
  • createdAt (40-40)
  • createdAt (45-45)
  • meta (49-49)
components/xola/sources/experience-deleted/experience-deleted.mjs (2)
  • params (38-38)
  • meta (55-55)
components/xola/sources/experience-updated/experience-updated.mjs (4)
  • params (33-33)
  • filteredExperiences (39-45)
  • createdAt (41-41)
  • meta (52-52)
components/xola/sources/common/webhook.mjs (1)
  • meta (56-56)
components/xola/sources/order-updated-instant/order-updated-instant.mjs (6)
components/xola/sources/experience-deleted-instant/experience-deleted-instant.mjs (1)
  • body (18-18)
components/xola/sources/experience-updated-instant/experience-updated-instant.mjs (1)
  • body (18-18)
components/xola/sources/new-experience-created-instant/new-experience-created-instant.mjs (1)
  • body (18-18)
components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (1)
  • body (18-18)
components/xola/sources/order-deleted-instant/order-deleted-instant.mjs (1)
  • body (18-18)
components/xola/sources/user-updated-instant/user-updated-instant.mjs (1)
  • body (18-18)
components/xola/actions/update-experience-schedule/update-experience-schedule.mjs (3)
components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (1)
  • response (153-168)
components/xola/actions/delete-experience-schedule/delete-experience-schedule.mjs (1)
  • response (36-40)
components/xola/actions/patch-event/patch-event.mjs (1)
  • response (64-84)
components/xola/actions/add-event-guide/add-event-guide.mjs (1)
components/xola/actions/remove-event-guide/remove-event-guide.mjs (1)
  • response (36-40)
components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (6)
components/xola/sources/experience-deleted-instant/experience-deleted-instant.mjs (1)
  • body (18-18)
components/xola/sources/experience-updated-instant/experience-updated-instant.mjs (1)
  • body (18-18)
components/xola/sources/new-experience-created-instant/new-experience-created-instant.mjs (1)
  • body (18-18)
components/xola/sources/order-deleted-instant/order-deleted-instant.mjs (1)
  • body (18-18)
components/xola/sources/order-updated-instant/order-updated-instant.mjs (1)
  • body (18-18)
components/xola/sources/user-updated-instant/user-updated-instant.mjs (1)
  • body (18-18)
components/xola/sources/experience-updated/experience-updated.mjs (2)
components/xola/sources/purchase-updated/purchase-updated.mjs (7)
  • lastUpdatedAt (31-31)
  • maxUpdatedAt (32-32)
  • params (33-33)
  • updatedAt (40-40)
  • updatedAt (48-48)
  • createdAt (41-41)
  • meta (52-52)
components/xola/sources/experience-created/experience-created.mjs (5)
  • params (33-33)
  • filteredExperiences (39-42)
  • createdAt (40-40)
  • createdAt (45-45)
  • meta (49-49)
components/xola/sources/experience-deleted/experience-deleted.mjs (6)
components/xola/sources/experience-created/experience-created.mjs (2)
  • params (33-33)
  • meta (49-49)
components/xola/sources/experience-updated/experience-updated.mjs (2)
  • params (33-33)
  • meta (52-52)
components/xola/sources/new-purchase-created/new-purchase-created.mjs (2)
  • params (33-33)
  • meta (49-49)
components/xola/sources/purchase-canceled/purchase-canceled.mjs (2)
  • params (34-34)
  • meta (46-46)
components/xola/sources/purchase-updated/purchase-updated.mjs (2)
  • params (33-33)
  • meta (52-52)
components/xola/sources/common/webhook.mjs (1)
  • meta (56-56)
components/xola/actions/patch-event/patch-event.mjs (2)
components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (1)
  • response (153-168)
components/xola/actions/update-experience-schedule/update-experience-schedule.mjs (1)
  • response (94-121)
components/xola/actions/remove-event-guide/remove-event-guide.mjs (2)
components/xola/actions/add-event-guide/add-event-guide.mjs (1)
  • response (43-52)
components/xola/actions/delete-experience-schedule/delete-experience-schedule.mjs (1)
  • response (36-40)
components/xola/sources/purchase-updated/purchase-updated.mjs (2)
components/xola/sources/experience-updated/experience-updated.mjs (7)
  • lastUpdatedAt (31-31)
  • maxUpdatedAt (32-32)
  • params (33-33)
  • updatedAt (40-40)
  • updatedAt (48-48)
  • createdAt (41-41)
  • meta (52-52)
components/xola/sources/new-purchase-created/new-purchase-created.mjs (5)
  • params (33-33)
  • filteredPurchases (39-42)
  • createdAt (40-40)
  • createdAt (45-45)
  • meta (49-49)
components/xola/sources/purchase-canceled/purchase-canceled.mjs (2)
components/xola/sources/new-purchase-created/new-purchase-created.mjs (3)
  • params (33-33)
  • filteredPurchases (39-42)
  • meta (49-49)
components/xola/sources/purchase-updated/purchase-updated.mjs (3)
  • params (33-33)
  • filteredPurchases (39-45)
  • meta (52-52)
components/xola/sources/new-purchase-created/new-purchase-created.mjs (1)
components/xola/sources/experience-created/experience-created.mjs (6)
  • lastCreatedAt (31-31)
  • maxCreatedAt (32-32)
  • params (33-33)
  • createdAt (40-40)
  • createdAt (45-45)
  • meta (49-49)
components/xola/sources/common/base.mjs (4)
components/xola/sources/experience-created/experience-created.mjs (1)
  • lastCreatedAt (31-31)
components/xola/sources/new-purchase-created/new-purchase-created.mjs (1)
  • lastCreatedAt (31-31)
components/xola/sources/experience-updated/experience-updated.mjs (1)
  • lastUpdatedAt (31-31)
components/xola/sources/purchase-updated/purchase-updated.mjs (1)
  • lastUpdatedAt (31-31)
components/xola/actions/delete-experience-schedule/delete-experience-schedule.mjs (3)
components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (1)
  • response (153-168)
components/xola/actions/remove-event-guide/remove-event-guide.mjs (1)
  • response (36-40)
components/xola/actions/update-experience-schedule/update-experience-schedule.mjs (1)
  • response (94-121)
components/xola/xola.app.mjs (1)
components/xola/sources/common/webhook.mjs (2)
  • userId (33-33)
  • hookId (32-32)
components/xola/sources/common/webhook.mjs (13)
components/xola/sources/experience-created/experience-created.mjs (1)
  • meta (49-49)
components/xola/sources/experience-deleted/experience-deleted.mjs (1)
  • meta (55-55)
components/xola/sources/experience-updated/experience-updated.mjs (1)
  • meta (52-52)
components/xola/sources/new-purchase-created/new-purchase-created.mjs (1)
  • meta (49-49)
components/xola/sources/purchase-canceled/purchase-canceled.mjs (1)
  • meta (46-46)
components/xola/sources/purchase-updated/purchase-updated.mjs (1)
  • meta (52-52)
components/xola/sources/experience-deleted-instant/experience-deleted-instant.mjs (1)
  • body (18-18)
components/xola/sources/experience-updated-instant/experience-updated-instant.mjs (1)
  • body (18-18)
components/xola/sources/new-experience-created-instant/new-experience-created-instant.mjs (1)
  • body (18-18)
components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (1)
  • body (18-18)
components/xola/sources/order-deleted-instant/order-deleted-instant.mjs (1)
  • body (18-18)
components/xola/sources/order-updated-instant/order-updated-instant.mjs (1)
  • body (18-18)
components/xola/sources/user-updated-instant/user-updated-instant.mjs (1)
  • body (18-18)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (23)
components/xola/sources/order-updated-instant/test-event.mjs (1)

1-26: LGTM!

The test event payload is well-structured with appropriate sample data for an order update webhook event. The structure includes all necessary fields (order details, experience, user info, and audit trail) in the correct format.

components/xola/sources/order-updated-instant/order-updated-instant.mjs (1)

1-2: LGTM!

Imports are correct and follow the established pattern for instant webhook sources.

components/xola/sources/new-order-created-instant/test-event.mjs (1)

1-21: LGTM!

Well-structured test fixture for order creation webhook events. The payload includes appropriate nested objects for experience and user, with realistic sample data.

components/xola/sources/new-purchase-created/test-event.mjs (1)

1-17: Clarify the distinction between "order" and "purchase".

This fixture is structurally identical to the order creation test event, but uses the "purchase" terminology. The PR includes both "new-order-created-instant" and "new-purchase-created" sources with nearly identical payloads.

Consider documenting whether these represent the same entity in Xola's API or if there's a meaningful distinction. This will help prevent confusion when users choose between these sources.

components/xola/sources/order-deleted-instant/test-event.mjs (1)

1-8: LGTM!

Appropriate minimal payload for order deletion events. The "canceled" status correctly reflects the deleted state.

components/xola/sources/experience-updated/test-event.mjs (1)

1-12: LGTM!

Clean test fixture with realistic experience data. The timestamps correctly show updatedAt after createdAt, reflecting an update scenario.

components/xola/sources/user-updated-instant/test-event.mjs (1)

1-17: LGTM!

Excellent test fixture demonstrating the audit trail functionality. The example clearly shows a phone number being added to a user profile, which is helpful for understanding the webhook payload structure.

components/xola/sources/experience-updated-instant/test-event.mjs (1)

1-29: LGTM!

Excellent comprehensive test fixture with a detailed audit trail. The payload demonstrates multiple field changes (description, duration, price) with clear before/after values, making it highly useful for testing and documentation.

components/xola/sources/new-experience-created-instant/test-event.mjs (1)

1-16: LGTM!

Properly structured creation event fixture. The empty audit object is correct since creation events have no prior state to track, and the matching createdAt/updatedAt timestamps appropriately reflect a newly created entity.

components/xola/sources/experience-created/test-event.mjs (1)

1-12: LGTM!

The test event fixture is well-structured and provides appropriate sample data for the experience-created source.

components/xola/sources/purchase-updated/test-event.mjs (1)

1-17: LGTM!

The test event fixture is well-structured with appropriate nested objects for experience and user data.

components/xola/actions/patch-event/patch-event.mjs (1)

64-84: LGTM!

The conditional spread syntax correctly handles optional fields, ensuring only provided values are sent to the API.

components/xola/sources/experience-created/experience-created.mjs (2)

30-56: LGTM with note on pagination.

The processEvent implementation correctly filters by createdAt, tracks the maximum timestamp, and persists state. The logic is sound assuming the API returns results in the expected order (newest first or all within limit).


17-22: Verify that the API returns experiences in descending order by createdAt and that 100 is sufficient for the polling interval.

The getParams method hardcodes skip: 0 with limit: 100 consistently across all polling sources (experience-created, experience-updated, experience-deleted, and all purchase sources). This pattern suggests intentional design rather than an oversight, but it relies on assumptions about API behavior:

  • The filtering logic depends on the API returning experiences sorted by recency (newest first)
  • If the API returns them in ascending order or unsorted, older experiences could be missed
  • If more than 100 experiences are created between polling intervals, any beyond position 100 won't be detected

Confirm with the Xola API documentation that /experiences returns results sorted by createdAt descending and that 100 is an appropriate limit for your polling frequency.

components/xola/actions/delete-experience-schedule/delete-experience-schedule.mjs (2)

24-28: LGTM!

The destructiveHint: true annotation correctly indicates this action permanently deletes data.


36-40: LGTM!

The delete operation is implemented correctly with appropriate error handling delegated to the app layer.

components/xola/sources/experience-deleted-instant/experience-deleted-instant.mjs (1)

1-27: LGTM!

The instant webhook source follows the established pattern correctly. The ID generation with timestamp suffix ensures uniqueness for deduplication, and the fallback from data.name to data.id in the summary handles missing names gracefully.

components/xola/sources/new-purchase-created/new-purchase-created.mjs (1)

1-59: LGTM!

The polling source implementation correctly:

  • Filters purchases by createdAt timestamp using state persistence
  • Updates maxCreatedAt while processing to track the latest item
  • Uses Date.parse() for parsing ISO date strings from the API
  • Handles the case where no new items exist (line 53 check)
components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (1)

17-24: LGTM!

The ID generation using data.id directly is appropriate for a "created" event, as newly created entities have unique IDs. The dedupe: "unique" setting will handle any duplicate webhook deliveries correctly.

components/xola/actions/remove-event-guide/remove-event-guide.mjs (1)

1-45: LGTM!

The action correctly removes a guide from an event with appropriate destructive annotations. The summary message clearly indicates the operation performed.

components/xola/sources/user-updated-instant/user-updated-instant.mjs (1)

1-27: LGTM!

The instant webhook source correctly handles user update events with:

  • Timestamp-suffixed ID for deduplication across multiple updates
  • Proper fallback chain (data.name || data.email) for the summary
  • Consistent structure following the established pattern
components/xola/sources/experience-updated/experience-updated.mjs (1)

39-45: Filter logic correctly identifies genuine updates.

The conditions properly exclude:

  • New creations (updatedAt !== createdAt)
  • Soft-deleted experiences (status !== "deleted")
  • Previously processed updates (updatedAt > lastUpdatedAt)
components/xola/sources/experience-deleted/experience-deleted.mjs (1)

36-61: Snapshot comparison logic is sound for detecting deletions.

The approach of comparing previous and current ID sets correctly identifies deletions. Note that experiences created and deleted between polling intervals won't be detected, but this is documented and an acceptable limitation of the polling approach.

@jcortes jcortes force-pushed the xola-new-components branch 2 times, most recently from 7f7c939 to 07b3fe5 Compare October 21, 2025 15:11
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

♻️ Duplicate comments (5)
components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (1)

55-60: Note: Days inconsistency already flagged in previous review.

A previous review comment identified that the days prop uses string[] with values "0" (Sunday) through "6" (Saturday), while the update action uses integer[] with values 1 (Monday) through 7 (Sunday). This inconsistency should be addressed.

components/xola/actions/delete-experience-schedule/delete-experience-schedule.mjs (1)

21-25: Verify method call: should this be this.app.getUser()?

Same issue as in create-experience-schedule: the custom options() method calls this.getUser(), but getUser() is defined on the app object. Please verify this resolves correctly.

components/xola/actions/add-event-guide/add-event-guide.mjs (2)

21-25: Verify method call: should this be this.app.getUser()?

Same pattern as other actions: verify that this.getUser() resolves correctly or should be this.app.getUser().


67-76: Note: Payload structure issue already flagged in previous review.

A previous review comment identified that the payload structure doesn't match the Xola API specification. The API expects a flat structure with guide_id, but the code sends a nested structure with guide.id and forceConfirm.

components/xola/actions/remove-event-guide/remove-event-guide.mjs (1)

21-25: Verify method call: should this be this.app.getUser()?

Same pattern as other actions: verify that this.getUser() resolves correctly or should be this.app.getUser().

🧹 Nitpick comments (2)
components/xola/sources/experience-updated-instant/test-event.mjs (1)

39-39: Consider adding sample schedule data.

With isScheduled: true but an empty schedules array, you might want to add at least one sample schedule entry to make the test event more realistic and improve test coverage of array-handling logic.

Also applies to: 49-49

components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (1)

17-24: Consider adding timestamp to ID for uniqueness.

The generateMeta() method uses data.id directly as the event ID. If the same order triggers multiple webhook deliveries (e.g., due to retries), this could lead to deduplication issues. Consider including a timestamp like the user-updated-instant source does:

id: `${data.id}-${ts}`,

However, if orders are immutable after creation and won't trigger duplicate "create" events, the current approach is acceptable.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ec3f3d9 and 07b3fe5.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (24)
  • components/xola/actions/add-event-guide/add-event-guide.mjs (1 hunks)
  • components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (1 hunks)
  • components/xola/actions/delete-experience-schedule/delete-experience-schedule.mjs (1 hunks)
  • components/xola/actions/patch-event/patch-event.mjs (1 hunks)
  • components/xola/actions/remove-event-guide/remove-event-guide.mjs (1 hunks)
  • components/xola/actions/update-experience-schedule/update-experience-schedule.mjs (1 hunks)
  • components/xola/common/constants.mjs (1 hunks)
  • components/xola/package.json (2 hunks)
  • components/xola/sources/common/webhook.mjs (1 hunks)
  • components/xola/sources/experience-deleted-instant/experience-deleted-instant.mjs (1 hunks)
  • components/xola/sources/experience-deleted-instant/test-event.mjs (1 hunks)
  • components/xola/sources/experience-updated-instant/experience-updated-instant.mjs (1 hunks)
  • components/xola/sources/experience-updated-instant/test-event.mjs (1 hunks)
  • components/xola/sources/new-experience-created-instant/new-experience-created-instant.mjs (1 hunks)
  • components/xola/sources/new-experience-created-instant/test-event.mjs (1 hunks)
  • components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (1 hunks)
  • components/xola/sources/new-order-created-instant/test-event.mjs (1 hunks)
  • components/xola/sources/order-deleted-instant/order-deleted-instant.mjs (1 hunks)
  • components/xola/sources/order-deleted-instant/test-event.mjs (1 hunks)
  • components/xola/sources/order-updated-instant/order-updated-instant.mjs (1 hunks)
  • components/xola/sources/order-updated-instant/test-event.mjs (1 hunks)
  • components/xola/sources/user-updated-instant/test-event.mjs (1 hunks)
  • components/xola/sources/user-updated-instant/user-updated-instant.mjs (1 hunks)
  • components/xola/xola.app.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (11)
  • components/xola/sources/new-order-created-instant/test-event.mjs
  • components/xola/common/constants.mjs
  • components/xola/sources/order-deleted-instant/order-deleted-instant.mjs
  • components/xola/sources/experience-deleted-instant/test-event.mjs
  • components/xola/actions/update-experience-schedule/update-experience-schedule.mjs
  • components/xola/package.json
  • components/xola/sources/experience-updated-instant/experience-updated-instant.mjs
  • components/xola/sources/new-experience-created-instant/new-experience-created-instant.mjs
  • components/xola/sources/order-deleted-instant/test-event.mjs
  • components/xola/sources/order-updated-instant/order-updated-instant.mjs
  • components/xola/sources/experience-deleted-instant/experience-deleted-instant.mjs
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.

Applied to files:

  • components/xola/sources/common/webhook.mjs
🧬 Code graph analysis (9)
components/xola/sources/user-updated-instant/user-updated-instant.mjs (6)
components/xola/sources/experience-deleted-instant/experience-deleted-instant.mjs (2)
  • body (18-18)
  • ts (19-19)
components/xola/sources/experience-updated-instant/experience-updated-instant.mjs (2)
  • body (18-18)
  • ts (19-19)
components/xola/sources/new-experience-created-instant/new-experience-created-instant.mjs (1)
  • body (18-18)
components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (1)
  • body (18-18)
components/xola/sources/order-deleted-instant/order-deleted-instant.mjs (2)
  • body (18-18)
  • ts (19-19)
components/xola/sources/order-updated-instant/order-updated-instant.mjs (2)
  • body (18-18)
  • ts (19-19)
components/xola/actions/delete-experience-schedule/delete-experience-schedule.mjs (2)
components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (1)
  • value (22-25)
components/xola/actions/update-experience-schedule/update-experience-schedule.mjs (1)
  • value (22-25)
components/xola/actions/add-event-guide/add-event-guide.mjs (2)
components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (2)
  • value (22-25)
  • response (120-135)
components/xola/actions/remove-event-guide/remove-event-guide.mjs (2)
  • value (22-25)
  • response (60-64)
components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (2)
components/xola/actions/add-event-guide/add-event-guide.mjs (2)
  • value (22-25)
  • response (67-76)
components/xola/actions/update-experience-schedule/update-experience-schedule.mjs (2)
  • value (22-25)
  • response (132-148)
components/xola/sources/common/webhook.mjs (2)
components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (1)
  • value (22-25)
components/xola/sources/new-experience-created-instant/new-experience-created-instant.mjs (1)
  • body (18-18)
components/xola/actions/patch-event/patch-event.mjs (1)
components/xola/actions/add-event-guide/add-event-guide.mjs (2)
  • value (22-25)
  • response (67-76)
components/xola/xola.app.mjs (7)
components/xola/actions/add-event-guide/add-event-guide.mjs (1)
  • value (22-25)
components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (1)
  • value (22-25)
components/xola/actions/delete-experience-schedule/delete-experience-schedule.mjs (1)
  • value (22-25)
components/xola/actions/patch-event/patch-event.mjs (1)
  • value (22-25)
components/xola/actions/remove-event-guide/remove-event-guide.mjs (1)
  • value (22-25)
components/xola/actions/update-experience-schedule/update-experience-schedule.mjs (1)
  • value (22-25)
components/xola/sources/common/webhook.mjs (1)
  • value (20-23)
components/xola/actions/remove-event-guide/remove-event-guide.mjs (1)
components/xola/actions/add-event-guide/add-event-guide.mjs (2)
  • value (22-25)
  • response (67-76)
components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (3)
components/xola/sources/new-experience-created-instant/new-experience-created-instant.mjs (1)
  • body (18-18)
components/xola/sources/order-updated-instant/order-updated-instant.mjs (1)
  • body (18-18)
components/xola/sources/user-updated-instant/user-updated-instant.mjs (1)
  • body (18-18)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (22)
components/xola/sources/order-updated-instant/test-event.mjs (1)

1-26: LGTM! Well-structured test fixture.

The test event payload is well-formed with realistic sample data for the "order.update" webhook. Field naming is consistent, data types are appropriate, and the audit trail correctly tracks the status change from "active" to "confirmed". This provides a solid fixture for testing the order-updated-instant source.

components/xola/sources/experience-updated-instant/test-event.mjs (1)

1-68: LGTM! Well-structured test event.

The test payload is comprehensive and realistic, with appropriate data types and structure for testing the experience update webhook.

components/xola/sources/new-experience-created-instant/test-event.mjs (3)

1-2: LGTM! Event structure follows Pipedream webhook patterns.

The export structure and event name are correctly formatted for the instant source integration.


3-67: Well-structured test event with comprehensive coverage.

The test event provides good coverage of the experience object schema with realistic data. Geographic coordinates align with the pickup address, timestamps use proper ISO 8601 format, and field types appear correct.


18-18: Review comment remains valid pending developer verification against Xola API reference.

The web search confirms that Xola's experience.create webhook includes a schedules field in the Experience object, which aligns with your second concern. However, the search results do not document:

  • State validation rules for status: "draft" combined with complete: true
  • Constraints requiring non-empty schedules when isScheduled: true

Your two flagged inconsistencies are reasonable concerns, but definitive confirmation requires checking Xola's full Experience schema or testing against their API to determine if these field combinations are:

  • Valid but unusual states
  • Invalid states that your test fixture should correct

Recommendation: Review the Xola API reference documentation directly (or their OpenAPI/schema files if available) to confirm whether:

  1. A draft experience can legitimately be marked complete
  2. A scheduled experience can have an empty schedules array

If these combinations are invalid, update the test fixture to match real experience.create webhook payloads.

components/xola/sources/user-updated-instant/test-event.mjs (1)

1-17: LGTM! Test event structure is well-formed.

The test event payload is clean and provides representative sample data for a user update webhook event.

components/xola/xola.app.mjs (3)

1-2: LGTM! Proper use of platform axios wrapper.

The imports follow Pipedream best practices by using the platform axios helper for request tracing.


238-281: LGTM! Clean HTTP abstraction layer.

The HTTP helper methods follow a consistent pattern and properly use the platform axios wrapper for request tracing.


282-377: LGTM! API methods follow consistent patterns.

The resource methods properly delegate to the HTTP helpers and maintain a clean, consistent interface across all operations.

components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (1)

104-139: LGTM! Action run method is well-structured.

The run method properly destructures props, constructs the payload, and returns a descriptive summary.

components/xola/actions/delete-experience-schedule/delete-experience-schedule.mjs (1)

53-70: LGTM! Deletion action is properly structured.

The destructive action correctly sets destructiveHint: true and returns a clear success response.

components/xola/sources/user-updated-instant/user-updated-instant.mjs (1)

1-28: LGTM! Webhook source follows consistent pattern.

The source properly extends the common webhook base and implements the required getEventName() and generateMeta() methods. The meta generation creates a unique ID by combining the data ID with timestamp.

components/xola/actions/remove-event-guide/remove-event-guide.mjs (1)

53-68: LGTM! Guide removal action is properly structured.

The action correctly passes eventId and guideId as path parameters to the DELETE endpoint, which is the appropriate structure for a removal operation.

components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (1)

1-27: LGTM! Order creation source follows established pattern.

The source properly implements the webhook interface and provides appropriate event metadata.

components/xola/sources/common/webhook.mjs (6)

34-50: LGTM!

The activate hook correctly creates a webhook with the required parameters and persists the webhook ID for cleanup.


51-64: LGTM!

The deactivate hook properly checks for webhook existence before attempting deletion, preventing errors during cleanup.


73-78: LGTM!

These unimplemented methods correctly enforce subclass implementation, consistent with the base-class pattern used in this codebase. Based on learnings.


79-94: LGTM!

The webhook creation and deletion methods follow proper RESTful patterns and correctly construct the API paths.


96-98: LGTM!

The run handler correctly emits the webhook payload with subclass-provided metadata.


12-31: ****

The userId prop with options() returning a single-element array is correct and intentional. The getUser() method fetches the currently authenticated user via the /users/me endpoint (with userId = "me" as default), which always returns exactly one user. Wrapping it in an array follows Pipedream's required options format. This pattern is consistent across all Xola components and is the proper way to provide dynamic prop values in this codebase.

Likely an incorrect or invalid review comment.

components/xola/actions/patch-event/patch-event.mjs (2)

4-13: LGTM!

The action metadata is appropriate, and the destructive hint correctly indicates that this operation modifies data.


49-54: LGTM!

The manual prop is correctly marked as optional, appropriate for a PATCH operation.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

♻️ Duplicate comments (5)
components/xola/xola.app.mjs (1)

49-52: Remove console logging in prod components.

Avoid console.error in option loaders; return [] or propagate the error. This was flagged previously and remains.

-        } catch (error) {
-          console.error(error);
+        } catch {
           return [];
         }
components/xola/actions/add-event-guide/add-event-guide.mjs (1)

67-76: Fix payload to match Xola API contract for assigning guides.

Body shape appears incorrect (nested guide object, camelCase). Xola commonly expects a flat body like { "guide_id": <id> }. Also confirm whether forceConfirm exists and, if so, whether its name should be snake_case.

Proposed minimal fix:

-    const response = await app.addEventGuide({
+    const response = await app.addEventGuide({
       $,
       eventId,
-      data: {
-        guide: {
-          id: guideId,
-          forceConfirm,
-        },
-      },
+      data: {
+        guide_id: guideId,
+        // If the API supports forcing assignment, rename accordingly, e.g.:
+        // force: Boolean(forceConfirm),
+      },
     });

To confirm the exact JSON body and field names, please check the latest Xola docs:

What is the exact JSON payload for POST /events/{eventId}/guides (assign a guide) in the Xola API? Include field names and an example body.
components/xola/sources/common/webhook.mjs (1)

8-8: Add explicit HTTP response handling for webhook reliability.

Following best practices for webhook sources (as seen in bandwidth and other integrations), you should configure customResponse: true on the http prop and explicitly respond before emitting the event. This ensures quick acknowledgment to the webhook sender while processing asynchronously.

Apply this diff to configure customResponse on the http prop:

-    http: "$.interface.http",
+    http: {
+      type: "$.interface.http",
+      customResponse: true,
+    },

Then update the run method to respond explicitly:

 async run({ body }) {
+  this.http.respond({
+    status: 204,
+  });
   this.$emit(body, this.generateMeta(body));
 },

Also applies to: 93-95

components/xola/actions/patch-event/patch-event.mjs (2)

43-48: Make the max prop optional for proper PATCH semantics.

The max prop is required, but PATCH operations are designed for partial updates. Users should be able to update only the manual flag without providing max.

Apply this diff:

 max: {
   type: "integer",
   label: "Max",
   description: "Maximum capacity override",
   min: 0,
+  optional: true,
 },

56-75: Filter undefined values from the PATCH payload.

Once max becomes optional, the data object may contain undefined values, which could cause API errors or unexpected behavior. Only include defined properties in the payload.

Apply this diff:

+    const data = {};
+    if (max !== undefined) data.max = max;
+    if (manual !== undefined) data.manual = manual;
+
     const response = await app.patchEvent({
       $,
       eventId,
-      data: {
-        max,
-        manual,
-      },
+      data,
     });
🧹 Nitpick comments (5)
components/xola/sources/order-updated-instant/test-event.mjs (1)

1-26: Consider adding documentation for the test fixture.

Adding a brief JSDoc comment explaining this is a sample webhook payload for testing purposes would improve maintainability. Additionally, documenting that the amount is in cents (if that's the Xola convention) would help future developers understand the data format.

Example:

+/**
+ * Sample webhook payload for order.update event.
+ * Used for testing the order-updated-instant source.
+ * Note: amount is in cents (12000 = $120.00 USD).
+ */
 export default {
   eventName: "order.update",
components/xola/actions/update-experience-schedule/update-experience-schedule.mjs (1)

115-152: Consider enriching the summary with identifiers.

Adding IDs helps users in multi-run contexts. Optional tweak:

-    $.export("$summary", `Successfully updated schedule \`${scheduleId}\` for experience with ID \`${experienceId}\``);
+    $.export("$summary", `Updated schedule \`${scheduleId}\` for experience \`${experienceId}\``);
components/xola/actions/delete-experience-schedule/delete-experience-schedule.mjs (1)

66-69: Improve summary with IDs (optional).

Helps trace which schedule/experience were affected.

-    $.export("$summary", "Successfully deleted schedule");
+    $.export("$summary", `Deleted schedule \`${scheduleId}\` from experience \`${experienceId}\``);
components/xola/xola.app.mjs (1)

238-241: URL join edge-cases (optional).

If api_url may end with / and VERSION_PATH begins with /, you can end up with //. Consider normalizing. Low priority.

-      return `${apiUrl}${constants.VERSION_PATH}${path}`;
+      const base = `${apiUrl}`.replace(/\/+$/, "");
+      const ver = `${constants.VERSION_PATH}`.replace(/^\/+/, "");
+      const p = `${path}`.replace(/^\/+/, "");
+      return `${base}/${ver}/${p}`;
components/xola/actions/add-event-guide/add-event-guide.mjs (1)

78-79: Enrich summary with IDs (optional).

Improves traceability.

-    $.export("$summary", "Successfully added guide to event");
+    $.export("$summary", `Added guide \`${guideId}\` to event \`${eventId}\``);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 07b3fe5 and e95e69a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (24)
  • components/xola/actions/add-event-guide/add-event-guide.mjs (1 hunks)
  • components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (1 hunks)
  • components/xola/actions/delete-experience-schedule/delete-experience-schedule.mjs (1 hunks)
  • components/xola/actions/patch-event/patch-event.mjs (1 hunks)
  • components/xola/actions/remove-event-guide/remove-event-guide.mjs (1 hunks)
  • components/xola/actions/update-experience-schedule/update-experience-schedule.mjs (1 hunks)
  • components/xola/common/constants.mjs (1 hunks)
  • components/xola/package.json (2 hunks)
  • components/xola/sources/common/webhook.mjs (1 hunks)
  • components/xola/sources/experience-deleted-instant/experience-deleted-instant.mjs (1 hunks)
  • components/xola/sources/experience-deleted-instant/test-event.mjs (1 hunks)
  • components/xola/sources/experience-updated-instant/experience-updated-instant.mjs (1 hunks)
  • components/xola/sources/experience-updated-instant/test-event.mjs (1 hunks)
  • components/xola/sources/new-experience-created-instant/new-experience-created-instant.mjs (1 hunks)
  • components/xola/sources/new-experience-created-instant/test-event.mjs (1 hunks)
  • components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (1 hunks)
  • components/xola/sources/new-order-created-instant/test-event.mjs (1 hunks)
  • components/xola/sources/order-deleted-instant/order-deleted-instant.mjs (1 hunks)
  • components/xola/sources/order-deleted-instant/test-event.mjs (1 hunks)
  • components/xola/sources/order-updated-instant/order-updated-instant.mjs (1 hunks)
  • components/xola/sources/order-updated-instant/test-event.mjs (1 hunks)
  • components/xola/sources/user-updated-instant/test-event.mjs (1 hunks)
  • components/xola/sources/user-updated-instant/user-updated-instant.mjs (1 hunks)
  • components/xola/xola.app.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (13)
  • components/xola/sources/new-order-created-instant/new-order-created-instant.mjs
  • components/xola/sources/experience-updated-instant/experience-updated-instant.mjs
  • components/xola/sources/order-deleted-instant/test-event.mjs
  • components/xola/common/constants.mjs
  • components/xola/sources/new-order-created-instant/test-event.mjs
  • components/xola/sources/new-experience-created-instant/new-experience-created-instant.mjs
  • components/xola/sources/order-updated-instant/order-updated-instant.mjs
  • components/xola/actions/create-experience-schedule/create-experience-schedule.mjs
  • components/xola/actions/remove-event-guide/remove-event-guide.mjs
  • components/xola/sources/order-deleted-instant/order-deleted-instant.mjs
  • components/xola/sources/new-experience-created-instant/test-event.mjs
  • components/xola/sources/user-updated-instant/test-event.mjs
  • components/xola/sources/experience-deleted-instant/experience-deleted-instant.mjs
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-07-24T02:06:47.016Z
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.

Applied to files:

  • components/xola/sources/common/webhook.mjs
🧬 Code graph analysis (7)
components/xola/actions/add-event-guide/add-event-guide.mjs (2)
components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (2)
  • value (22-25)
  • response (120-135)
components/xola/actions/remove-event-guide/remove-event-guide.mjs (2)
  • value (22-25)
  • response (60-64)
components/xola/actions/delete-experience-schedule/delete-experience-schedule.mjs (3)
components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (1)
  • value (22-25)
components/xola/actions/update-experience-schedule/update-experience-schedule.mjs (1)
  • value (22-25)
components/xola/sources/common/webhook.mjs (1)
  • value (17-20)
components/xola/sources/user-updated-instant/user-updated-instant.mjs (6)
components/xola/sources/experience-deleted-instant/experience-deleted-instant.mjs (2)
  • body (18-18)
  • ts (19-19)
components/xola/sources/experience-updated-instant/experience-updated-instant.mjs (2)
  • body (18-18)
  • ts (19-19)
components/xola/sources/new-experience-created-instant/new-experience-created-instant.mjs (1)
  • body (18-18)
components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (1)
  • body (18-18)
components/xola/sources/order-deleted-instant/order-deleted-instant.mjs (2)
  • body (18-18)
  • ts (19-19)
components/xola/sources/order-updated-instant/order-updated-instant.mjs (2)
  • body (18-18)
  • ts (19-19)
components/xola/actions/update-experience-schedule/update-experience-schedule.mjs (1)
components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (2)
  • value (22-25)
  • response (120-135)
components/xola/actions/patch-event/patch-event.mjs (3)
components/xola/actions/add-event-guide/add-event-guide.mjs (2)
  • value (22-25)
  • response (67-76)
components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (2)
  • value (22-25)
  • response (120-135)
components/xola/actions/remove-event-guide/remove-event-guide.mjs (2)
  • value (22-25)
  • response (60-64)
components/xola/xola.app.mjs (7)
components/xola/actions/add-event-guide/add-event-guide.mjs (1)
  • value (22-25)
components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (1)
  • value (22-25)
components/xola/actions/delete-experience-schedule/delete-experience-schedule.mjs (1)
  • value (22-25)
components/xola/actions/patch-event/patch-event.mjs (1)
  • value (22-25)
components/xola/actions/remove-event-guide/remove-event-guide.mjs (1)
  • value (22-25)
components/xola/actions/update-experience-schedule/update-experience-schedule.mjs (1)
  • value (22-25)
components/xola/sources/common/webhook.mjs (1)
  • value (17-20)
components/xola/sources/common/webhook.mjs (3)
components/xola/actions/add-event-guide/add-event-guide.mjs (1)
  • value (22-25)
components/xola/actions/create-experience-schedule/create-experience-schedule.mjs (1)
  • value (22-25)
components/xola/sources/new-experience-created-instant/new-experience-created-instant.mjs (1)
  • body (18-18)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (5)
components/xola/sources/experience-deleted-instant/test-event.mjs (1)

63-64: The duration and eventDuration values are not inconsistent—they represent different properties.

The duration: 1 and eventDuration: 1440 fields serve different purposes. Across all Xola experience test fixtures, duration consistently remains 1 while eventDuration varies based on the actual event length in minutes. For example, eventDuration: 1440 represents 24 hours (full day), and other fixtures show eventDuration: 180 (3 hours) with the same duration: 1. The duration field appears to represent the schedule unit count, while eventDuration represents the actual duration in minutes. These values are semantically consistent and require no change.

Likely an incorrect or invalid review comment.

components/xola/sources/order-updated-instant/test-event.mjs (2)

20-25: Inconsistent AI summary regarding audit field.

The AI-generated summary states "audit: not present" but the code clearly includes an audit object with status transition information. The actual implementation includes audit tracking, which is useful for understanding what changed in the order update event.


21-24: No changes needed—"active" is a valid order status.

The search results confirm "active" is a valid Xola order status. It appears in components/xola/sources/new-order-created-instant/test-event.mjs as the initial status when a new order is created. The audit transition from "active" to "confirmed" in the code under review reflects a realistic state progression and is consistent with the test data patterns used across the Xola components.

components/xola/package.json (1)

3-3: Version bump and platform dependency look good.

v0.1.0 aligns with new public actions, and @pipedream/platform ^3.1.0 matches current SDK guidance. No issues from me.

Also applies to: 15-17

components/xola/actions/update-experience-schedule/update-experience-schedule.mjs (1)

59-65: Good: schedule enums align across actions.

type and repeat now derive from the app propDefinitions (available|blackout, weekly|custom), resolving prior inconsistencies with create-schedule.

If the create action still hardcodes different enums, consider switching it to use the same app propDefinitions for consistency.

Also applies to: 90-95

Comment on lines +21 to +32
async options() {
const {
id: value,
name: label,
} = await this.getUser();
return [
{
label,
value,
},
];
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Seller ID options likely returning a User ID instead of Seller ID.

Same pattern: this.getUser() returns the user, not the seller. Remove this override or map to the seller’s ID.

     sellerId: {
       propDefinition: [
         app,
         "sellerId",
       ],
-      async options() {
-        const {
-          id: value,
-          name: label,
-        } = await this.getUser();
-        return [
-          {
-            label,
-            value,
-          },
-        ];
-      },
     },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async options() {
const {
id: value,
name: label,
} = await this.getUser();
return [
{
label,
value,
},
];
},
sellerId: {
propDefinition: [
app,
"sellerId",
],
},
🤖 Prompt for AI Agents
In components/xola/actions/add-event-guide/add-event-guide.mjs around lines 21
to 32, the options() override is calling this.getUser() which returns a User
object, so the returned value is a User ID rather than the Seller ID; change the
call to retrieve the seller (e.g., call this.getSeller() and destructure its id
and name) or, if only getUser() is available, map to the seller id via
user.seller.id and seller name for label, then return that seller id/value
instead of the user id. Ensure the label/value reflect the seller (not the user)
and remove the override if it’s unnecessary.

Comment on lines +21 to +32
async options() {
const {
id: value,
name: label,
} = await this.getUser();
return [
{
label,
value,
},
];
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Seller ID options likely returning a User ID instead of Seller ID.

Same issue as in the update action: this.getUser() returns a user, not a seller. This will mis-populate sellerId and break downstream filters. Remove the override or resolve seller.id.

     sellerId: {
       propDefinition: [
         app,
         "sellerId",
       ],
-      async options() {
-        const {
-          id: value,
-          name: label,
-        } = await this.getUser();
-        return [
-          {
-            label,
-            value,
-          },
-        ];
-      },
     },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async options() {
const {
id: value,
name: label,
} = await this.getUser();
return [
{
label,
value,
},
];
},
sellerId: {
propDefinition: [
app,
"sellerId",
],
},
🤖 Prompt for AI Agents
In
components/xola/actions/delete-experience-schedule/delete-experience-schedule.mjs
around lines 21 to 32, the options() override is using this.getUser() which
returns a user object so the returned value is a User ID instead of the Seller
ID expected by downstream filters; update the implementation to return the
seller's id (e.g., obtain the seller object or seller.id from the authenticated
user) or remove this override so the original seller-based options logic is
used, ensuring the returned value is seller.id and the label remains the seller
name.

Comment on lines +21 to +32
async options() {
const {
id: value,
name: label,
} = await this.getUser();
return [
{
label,
value,
},
];
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Seller ID options likely returning a User ID instead of Seller ID.

Using const { id: value, name: label } = await this.getUser(); will set Seller ID to the authenticated user’s ID, not the seller’s ID. Downstream lookups use sellerId to filter experiences/events, so this will likely break filters. Remove this override and rely on the app’s sellerId propDefinition (which lists sellers), or resolve the seller ID from the user object (e.g., user.seller.id) if that’s the API shape.

Apply this to remove the incorrect override and inherit the canonical options:

     sellerId: {
       propDefinition: [
         app,
         "sellerId",
       ],
-      async options() {
-        const {
-          id: value,
-          name: label,
-        } = await this.getUser();
-        return [
-          {
-            label,
-            value,
-          },
-        ];
-      },
     },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async options() {
const {
id: value,
name: label,
} = await this.getUser();
return [
{
label,
value,
},
];
},
🤖 Prompt for AI Agents
In
components/xola/actions/update-experience-schedule/update-experience-schedule.mjs
around lines 21–32, the options() implementation destructures the authenticated
user's id into the Seller ID (const { id: value, name: label } = await
this.getUser()), which returns the user ID not the seller ID; remove this
override and instead return the canonical seller options: either rely on the
existing sellerId propDefinition (so return that prop's options or leave options
undefined to inherit it) or, if the API shape exposes a seller on the user,
extract the seller id and name from the user object (e.g., user.seller.id and
user.seller.name) and return those as { value, label }; ensure downstream code
receives the actual sellerId used for filtering.

"earlyReturn": false,
"priceSchemes": [],
"pickupAddress": "456 Mountain Trail Rd, Boulder, CO 80302",
"isScheduled": true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Inconsistent isScheduled and schedules relationship.

The test fixture sets isScheduled: true but provides an empty schedules array. In real webhook payloads, a scheduled experience would typically include at least one schedule object. This inconsistency may lead to inadequate test coverage or mislead developers about expected payload structure.

Consider adding at least one sample schedule entry:

     "demographics": [],
-    "schedules": [],
+    "schedules": [
+      {
+        "id": "5f8b3c9d2e4f5a6b7c8d9e11",
+        "name": "Morning Session",
+        "startTime": "09:00",
+        "capacity": 10
+      }
+    ],
     "virtualMeeting": {

Also applies to: 49-49

🤖 Prompt for AI Agents
In components/xola/sources/experience-updated-instant/test-event.mjs around
lines 39 and 49, the fixture sets "isScheduled": true but provides an empty
"schedules" array which is inconsistent with real webhook payloads; update the
fixture so that when isScheduled is true it contains at least one representative
schedule object (e.g., with fields like id, startDate, endDate, timezone,
recurrence or similar fields used by the codebase) to mirror realistic payloads
and improve test coverage.

Comment on lines +62 to +74
const data = await this.listEvents({
params: {
seller: sellerId,
limit: constants.DEFAULT_LIMIT,
skip: page * constants.DEFAULT_LIMIT,
},
});
return data.map(({
id: value, title: label,
}) => ({
label,
value,
}));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Bug: listEvents response handling assumes array root.

Other list loaders destructure { data }. Here const data = await this.listEvents(...) then data.map(...) will break if the API returns { data: [...] } (likely, given other endpoints). Align with the others.

-        const data = await this.listEvents({
+        const { data } = await this.listEvents({
           params: {
             seller: sellerId,
             limit: constants.DEFAULT_LIMIT,
             skip: page * constants.DEFAULT_LIMIT,
           },
         });
         return data.map(({
           id: value, title: label,
         }) => ({
           label,
           value,
         }));
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const data = await this.listEvents({
params: {
seller: sellerId,
limit: constants.DEFAULT_LIMIT,
skip: page * constants.DEFAULT_LIMIT,
},
});
return data.map(({
id: value, title: label,
}) => ({
label,
value,
}));
const { data } = await this.listEvents({
params: {
seller: sellerId,
limit: constants.DEFAULT_LIMIT,
skip: page * constants.DEFAULT_LIMIT,
},
});
return data.map(({
id: value, title: label,
}) => ({
label,
value,
}));
🤖 Prompt for AI Agents
In components/xola/xola.app.mjs around lines 62 to 74, the code assigns const
data = await this.listEvents(...) then calls data.map(...), but other list
loaders expect the API to return an object with a data array (e.g. { data: [...]
}), so change the await line to destructure the response like const { data = []
} = await this.listEvents(...) (or similar) and then map over that data array;
ensure you handle a missing or non-array data by defaulting to an empty array
before mapping and preserve the same output shape { label, value }.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Xola

1 participant